#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>

char * _strcpy(char *va, char *vb)
{
    /*1209:	f3 0f 1e fa          	endbr64 
    120d:	55                   	push   %rbp
    120e:	48 89 e5             	mov    %rsp,%rbp
    1211:	48 83 ec 20          	sub    $0x20,%rsp
    1215:	48 89 7d e8          	mov    %rdi,-0x18(%rbp)	// va
    1219:	48 89 75 e0          	mov    %rsi,-0x20(%rbp)	// vb

    121d:	48 83 7d e8 00       	cmpq   $0x0,-0x18(%rbp)
    1222:	74 07                	je     122b <_strcpy+0x22>

    1224:	48 83 7d e0 00       	cmpq   $0x0,-0x20(%rbp)
    1229:	75 1f                	jne    124a <_strcpy+0x41>

    122b:	48 8d 0d 56 0e 00 00 	lea    0xe56(%rip),%rcx        # 2088 <__PRETTY_FUNCTION__.3028>
    1232:	ba 08 00 00 00       	mov    $0x8,%edx
    1237:	48 8d 35 ca 0d 00 00 	lea    0xdca(%rip),%rsi        # 2008 <_IO_stdin_used+0x8>
    123e:	48 8d 3d cb 0d 00 00 	lea    0xdcb(%rip),%rdi        # 2010 <_IO_stdin_used+0x10>
    1245:	e8 a6 fe ff ff       	callq  10f0 <__assert_fail@plt>*/
		assert( (va != NULL) && (vb != NULL));

    /*124a:	48 8b 45 e8          	mov    -0x18(%rbp),%rax	// rax=va
    124e:	48 89 45 f8          	mov    %rax,-0x8(%rbp)*/
		char *a = va;

    /*1252:	90                   	nop
    1253:	48 8b 55 e0          	mov    -0x20(%rbp),%rdx		// rdx=vb
    1257:	48 8d 42 01          	lea    0x1(%rdx),%rax		// rax=vb+1
    125b:	48 89 45 e0          	mov    %rax,-0x20(%rbp)		// vb=vb+1

    125f:	48 8b 45 e8          	mov    -0x18(%rbp),%rax		// rax=va
    1263:	48 8d 48 01          	lea    0x1(%rax),%rcx		// rcx=va+1
    1267:	48 89 4d e8          	mov    %rcx,-0x18(%rbp)		// va=va+1
    126b:	0f b6 12             	movzbl (%rdx),%edx			// edx=*vb
    126e:	88 10                	mov    %dl,(%rax)			// *va=*vb
    1270:	0f b6 00             	movzbl (%rax),%eax			// eax=*va
    1273:	84 c0                	test   %al,%al
    1275:	75 dc                	jne    1253 <_strcpy+0x4a>*/
		while ( (*va++ = *vb++) != '\0');

    /*1277:	48 8b 45 f8          	mov    -0x8(%rbp),%rax
    127b:	c9                   	leaveq 
    127c:	c3                   	retq   */
		return a;
}

int main()
{
    /*127d:	f3 0f 1e fa          	endbr64 
    1281:	55                   	push   %rbp
    1282:	48 89 e5             	mov    %rsp,%rbp
    1285:	53                   	push   %rbx
    1286:	48 83 ec 38          	sub    $0x38,%rsp
    128a:	64 48 8b 04 25 28 00 	mov    %fs:0x28,%rax
    1291:	00 00 
    1293:	48 89 45 e8          	mov    %rax,-0x18(%rbp)
    1297:	31 c0                	xor    %eax,%eax

    1299:	c7 45 e3 61 73 64 66 	movl   $0x66647361,-0x1d(%rbp)
    12a0:	c6 45 e7 00          	movb   $0x0,-0x19(%rbp)*/
		char a[5] = "asdf";

    /*12a4:	48 8d 05 85 0d 00 00 	lea    0xd85(%rip),%rax        # 2030 <_IO_stdin_used+0x30>
    12ab:	48 89 45 d0          	mov    %rax,-0x30(%rbp)*/
		char *p1 = "name";

    /*12af:	bf 14 00 00 00       	mov    $0x14,%edi
    12b4:	e8 57 fe ff ff       	callq  1110 <malloc@plt>
    12b9:	48 89 45 d8          	mov    %rax,-0x28(%rbp)*/
		char *p2 = malloc(20);

    /*12bd:	48 8b 45 d8          	mov    -0x28(%rbp),%rax
    12c1:	ba 14 00 00 00       	mov    $0x14,%edx
    12c6:	be 00 00 00 00       	mov    $0x0,%esi
    12cb:	48 89 c7             	mov    %rax,%rdi
    12ce:	e8 2d fe ff ff       	callq  1100 <memset@plt>*/
		memset(p2, 0, 20);

    /*12d3:	48 8d 05 5e 0d 00 00 	lea    0xd5e(%rip),%rax        # 2038 <_IO_stdin_used+0x38>
    12da:	48 89 45 d8          	mov    %rax,-0x28(%rbp)*/
		p2 = "xiaozhixiaozhixiaozhixiaozhixiaozhixiaozhi";

    /*12de:	48 8d 45 e3          	lea    -0x1d(%rbp),%rax	// rax=a
    12e2:	48 89 c7             	mov    %rax,%rdi
    12e5:	e8 d6 fd ff ff       	callq  10c0 <strlen@plt>	// strlen(a)
    12ea:	48 89 c3             	mov    %rax,%rbx			// rbx=strlen(a)
    12ed:	48 8b 45 d0          	mov    -0x30(%rbp),%rax		// p1
    12f1:	48 89 c7             	mov    %rax,%rdi
    12f4:	e8 c7 fd ff ff       	callq  10c0 <strlen@plt>	// strlen(p1)
    12f9:	48 89 c2             	mov    %rax,%rdx			// rdx=strlen(p1)
    12fc:	48 8b 45 d0          	mov    -0x30(%rbp),%rax		// rax=p1
    1300:	41 b9 05 00 00 00    	mov    $0x5,%r9d			// r9d=5
    1306:	49 89 d8             	mov    %rbx,%r8				// r8=strlen(a)
    1309:	b9 08 00 00 00       	mov    $0x8,%ecx			// ecx=8
    130e:	48 89 c6             	mov    %rax,%rsi			// rsi=p1
    1311:	48 8d 3d 4b 0d 00 00 	lea    0xd4b(%rip),%rdi        # 2063 <_IO_stdin_used+0x63>
    1318:	b8 00 00 00 00       	mov    $0x0,%eax
    131d:	e8 be fd ff ff       	callq  10e0 <printf@plt>*/
		printf("%s %d %d %d %d\n", p1, strlen(p1), 8, strlen(a), 5);	

    /*1322:	48 8b 45 d8          	mov    -0x28(%rbp),%rax		// rax=p2
    1326:	48 89 c7             	mov    %rax,%rdi			// rdi=p2
    1329:	e8 92 fd ff ff       	callq  10c0 <strlen@plt>	// strlen(p2)
    132e:	48 89 c2             	mov    %rax,%rdx			// rdx=strlen(p2)
    1331:	48 8b 45 d8          	mov    -0x28(%rbp),%rax		// rax=p2
    1335:	b9 08 00 00 00       	mov    $0x8,%ecx			// ecx=8
    133a:	48 89 c6             	mov    %rax,%rsi			// rsi=p2
    133d:	48 8d 3d 33 0d 00 00 	lea    0xd33(%rip),%rdi        # 2077 <_IO_stdin_used+0x77>
    1344:	b8 00 00 00 00       	mov    $0x0,%eax
    1349:	e8 92 fd ff ff       	callq  10e0 <printf@plt>*/
		printf(" %s %d %d\n", p2, strlen(p2), 8);	

    /*134e:	c7 45 cc 00 00 00 00 	movl   $0x0,-0x34(%rbp)*/
		int i = 0;

    /*1355:	eb 1c                	jmp    1373 <main+0xf6>
    1357:	48 8b 45 d0          	mov    -0x30(%rbp),%rax		// rax=p1
    135b:	48 8d 50 01          	lea    0x1(%rax),%rdx		// rdx=p1+1
    135f:	48 89 55 d0          	mov    %rdx,-0x30(%rbp)		// p1=p1+1
    1363:	0f b6 10             	movzbl (%rax),%edx			// edx=*p1
    1366:	8b 45 cc             	mov    -0x34(%rbp),%eax		// eax=i
    1369:	48 98                	cltq   
    136b:	88 54 05 e3          	mov    %dl,-0x1d(%rbp,%rax,1)	// a[i]=*p1
    136f:	83 45 cc 01          	addl   $0x1,-0x34(%rbp)			// i+1
    1373:	83 7d cc 02          	cmpl   $0x2,-0x34(%rbp)			// 0x2?=i
    1377:	7e de                	jle    1357 <main+0xda>*/
		for (i = 0; i < 3; i++)
			a[i] = *p1++;

    /*1379:	48 8d 45 e3          	lea    -0x1d(%rbp),%rax
    137d:	48 89 c7             	mov    %rax,%rdi
    1380:	e8 2b fd ff ff       	callq  10b0 <puts@plt>
    1385:	b8 00 00 00 00       	mov    $0x0,%eax*/
		puts(a);

    /*138a:	48 8b 4d e8          	mov    -0x18(%rbp),%rcx
    138e:	64 48 33 0c 25 28 00 	xor    %fs:0x28,%rcx
    1395:	00 00 
    1397:	74 05                	je     139e <main+0x121>
    1399:	e8 32 fd ff ff       	callq  10d0 <__stack_chk_fail@plt>
    139e:	48 83 c4 38          	add    $0x38,%rsp
    13a2:	5b                   	pop    %rbx
    13a3:	5d                   	pop    %rbp
    13a4:	c3                   	retq   
    13a5:	66 2e 0f 1f 84 00 00 	nopw   %cs:0x0(%rax,%rax,1)
    13ac:	00 00 00 
    13af:	90                   	nop*/
		return 0;
}
